<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
	<title>playDialog</title>
	<meta http-equiv="content-type" content="text/html; charset=gb2312"/>
	<meta http-equiv="Access-Control-Allow-Origin" content="*">
	<meta name="page-view-size" content="1280*720"/>
	<meta name="author" content=""/>
</head>

<style type="text/css">
body	{margin:0;padding:0;height:100%;}
</style>
</head>

<script type="text/javascript">
$G =
{
	debugMode: 1,

	trace: function( S )
	{
		var E = document.getElementById( 'eINFO' );
		E.innerHTML = S;
	},

	makeMRL: function( S )
	{
		try
		{
			// 分解出资产名
			var assetId = S.replace( /.*\//, '' ).replace( /\.ts/, '.vts' );

			// 根据资产名分配流服务器
			// REAL 开头的视为本地录制内容, 其他视为本地上传内容.
			var vsip,
				vsport = '13142',
				providerId = 'EVMTV';

			if( /^REAL/.test( assetId ))
			{
				vsip = '10.61.3.62';
			}
			else
			{
				vsip = '10.61.3.82';
			}

			// 拼接点播串
			//var MRL = 'rtsp://' + vsip + ':' + vsport + '/;purchaseToken=' + assetId + ';'
			var MRL = 'http://' + vsip + '/media/media/' + providerId + '_' + assetId;
			$G.trace( "SrcMRL = '" + S + "'<br>DstMRL = '" + MRL + "'" );
			return MRL;
		}
		catch( E )
		{
			$G.trace( "Play Error: <br><br>E = '" + E );
		}
	},

	init: function()
	{
		var href = window.location.href;
		var video = href.substring( href.indexOf('movename=')+9, href.length );
		var mrl = this.makeMRL( video );
		this.setVideo( mrl );
	},

	setVideo: function( MRL )
	{
//		var v = document.createElement('video');
//		v.src = MRL;
//		v.setAttribute("autoplay","autoplay");
//		v.setAttribute("controls","controls");
//		v.style.width = '100%';
//		v.style.height =  '100%';
//		v.innerHTML = '您的浏览器不支持播放';
//		document.documentElement.appendChild(v);
		document.getElementsByName('MRL')[0].value = MRL;
	}
}

</script>

<body onload="$G.init()">

<div id="eINFO" style="position:absolute;left:10px;top:630px;font:bold 24px tahoma;color:#f00"></div>

<!--<video src="http://10.61.3.112/hls/Piano_chineun_daetonryeong-MPEG2-TS.ts" controls/>-->

<OBJECT classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" id="vlc"
    codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab"
       width="800" height="600" id="vlc" events="True">
 <param name="ShowDisplay" value="False" />
 <param name="AutoLoop" value="False" />
 <param name="AutoPlay" value="False" />
 <param name="Time" value="True"/>
 <param name="MRL" value="dummy" />
 <EMBED pluginspage="http://www.videolan.org"
       type="application/x-vlc-plugin"
       version="VideoLAN.VLCPlugin.2"
       width="800"
       height="600"
       text="Waiting for video"
       name="vlc"
       ></EMBED>
 </OBJECT>


</body>
</html>